package com.kin207.netty.session;

import java.net.SocketAddress;
import java.util.Map;
import java.util.Set;

import com.google.common.eventbus.EventBus;
import com.kin207.netty.listener.eventbus.CreatedListenerEvent;
import com.kin207.netty.listener.eventbus.DestroyedListenerEvent;
import com.kin207.netty.listener.eventbus.ListenerEvent;
import com.kin207.netty.server.IServer;

import io.netty.channel.ChannelHandlerContext;

public interface ISessionManager {
	public Session addSession(ChannelHandlerContext ctx);
	
	public Session addSession(SocketAddress socketAddress, ChannelHandlerContext ctx);
	
	public Session removeSession(ChannelHandlerContext ctx);
	
	public Session getSession(ChannelHandlerContext ctx);
	
	public Session removeSession(String key);
	
	public int sessions();
	
	public boolean addName(String name, ChannelHandlerContext ctx);
	
	public Session removeName(ChannelHandlerContext ctx);
	
	public int names();
	
	public void addGroup(String groupName, ChannelHandlerContext ctx);
	
	public int removeGroup(String groupName, ChannelHandlerContext ctx);
	
	public int groups();
	
	public int close(ChannelHandlerContext ctx);
	
	public Map<String, Session> getSessions();

	public Map<String, Set<String>> getGroups();

}
